
<template tag="以下文档内容为hycli自动生成">
  <div>
   
    <!-- 批量修改状态 -->
    <el-dialog v-model="conf.aaawh_visible" 
        draggable
      title="批量修改状态" :close-on-click-modal="false"  width="60%"
      top="10vh" 
      :before-close="hide_aaawh">
    <el-form  ref="fm_aaawh" :model="form_aaawh" :rules="rules_aaawh">
    <el-row>
    <el-col :span="12">
    <!-- {"index":11,"raw":"tstatus","name":"tstatus","cname":"Tstatus","type":{"raw":"number(2)","name":"number","len":2,"dlen":0},"defValue":"","allowNull":false,"constraints":["l","le","q","fq","c","u","sl","arc","tp(multiselect,q)","tp(radio)","v","color"],"desc":{"raw":"测试状态","name":"测试状态"}} -->
    <el-form-item prop="tstatus" label="测试状态" label-width="100px" label-position="right">
      <el-radio-group v-model="form_aaawh.tstatus"   >
        <el-radio-button v-for="item in tstatusList" :key="item.value" :label="item.value" >
            {{item.name}}
        </el-radio-button>
      </el-radio-group>
    </el-form-item>
    </el-col>
    </el-row>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="hide_aaawh" icon="close">取消</el-button>
        <el-button type="primary" @click="save_aaawh" icon="select">提交</el-button>
      </span>
    </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data(){
    return{
      conf:{
        aaawh_visible:false,//批量修改状态
      },
      form_aaawh:{},//批量修改状态
      //批量修改状态
      rules_aaawh:{ 
        tstatus:[{required:true, message:"请输入测试状态", trigger: 'blur'}],
      },
    }
  },
  methods:{
     //--------------------批量修改状态---------------------------------
      //显示 批量修改状态 弹出框
      show_aaawh(fm){
        //处理输入参数
        let currentForm = {}
        Object.assign(this.form_aaawh,currentForm)
        this.form_aaawh.tstatus = fm.tstatus
        this.form_aaawh.tsk_id = fm.tsk_id
        //特殊参数处理
        // this.form_aaawh.tsk_id = (this.bcheck||[]).join(",")
        this.loadEnums_aaawh()
        this.conf.aaawh_visible = true;
      },

      //隐藏 批量修改状态 弹出框
      hide_aaawh(){
        this.conf.aaawh_visible = false;
        this.$refs.fm_aaawh.resetFields();
      },

      //保存 批量修改状态 弹出框数据
      save_aaawh(){
        let that = this
        this.$refs.fm_aaawh.validate((v=>{
          if(!v) return
          let post_form_aaawh = this.form_aaawh
          this.$theia.http.post("/ws/test/task/btcng",post_form_aaawh).then(res=>{
            that.$notify.success({title: '成功',message: '提交成功',duration:5000})
            that.$emit("onsaved")
            that.hide_aaawh()
          }).catch(res=>{
            let code = ((res||{}).response||{}).status||0
            let msg= `提交失败(${code})`
            that.$notify.error({title: '失败',message:msg,duration:5000})
          })
      }))
    },
    //批量修改状态
    loadEnums_aaawh(){
        //测试状态
        this.tstatusList = this.$theia.enum.get("tstatus","","" ,false,"")
    },

  },
}
</script>
<style scoped>
.form_item_info{
  margin-left: 4px;
  color:#999;
}
.form_item_info:hover{
  cursor: pointer;
  font-weight: 500;
  color:#333;
}
</style>